import jwt,time

class Mjwt:
    def __init__(self):
        self.key = "asfasdf#!$#%@$%@$TSDFSDFSDF"
    
    def encode(self, payload):
        return jwt.encode(payload, self.key,algorithm='HS256')
    
    def decode(self, token):
        try:
            return jwt.decode(token, self.key,algorithms=['HS256'])
        except Exception as e:
            print("Error decoding JWT:", e)
            return None
        
        
myjwt = Mjwt()
# token = myjwt.encode({"userid": "1",'exp':int(time.time())+60*5})
# print(token)
# print(myjwt.decode(token))